<%-- 自定义实体添加页面 --%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/views/common/taglibs.jsp" %>

<!DOCTYPE>
<html>
<head>
    <!-- 引入通用js、css文件(xiaogq) -->
    <meta name="decorator" content="bootstrap"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/common/operation/sys_operation.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/css/common/form/form_view.css"/>
</head>
<body>
    <!-- 加载列表操作 -->
    <div class="button_list">
        <jsp:include page="/views/common/operation/sys_operation.jsp" flush="true" />
    </div>
    <div class="content row">
        <h3>基础信息</h3>
        <hr>
        <jsp:include page="/views/common/form/form_view.jsp" flush="true" />
    </div>

    <div class="related_emp_div content row" style="position: relative;">
        <h3>相关部门</h3>
        <hr>
        <button class="btn btn-primary" style="position: absolute;" id="pk_t_2_1_osv" onclick="parent.filterQuoteClick(this,true,true,'${id}','${datas.pk_t_2_1}')">加入部门</button>
        <table id="related_dept_table"
               data-striped="true"
               data-toggle="table"
               data-show-columns="true"
               data-cookie="false"
               data-pagination="true"
               data-search="true"
               data-show-refresh="true"
               data-url="${ctx}/Dept/queryEmpRelateDeptAll.do?empId=${id}"
               data-side-pagination="server"
               data-checkbox-header="true"
               data-page-list="[10,20,30,50]"
               class="table">
            <thead>
            <tr>
                <th data-field='operation' data-formatter='showColOperator'>操作</th>
                <th data-field="id" data-visible="false">ID</th>
                <th data-field="name_varchar" data-sortable="true">部门名称</th>
                <th data-field="pk_t_2_1" data-sortable="true">父级部门</th>
                <th data-field="plait_people_decimal" data-sortable="true">编制人数</th>
                <th data-field="flag_bit" data-sortable="true">停用标志</th>
                <th data-field="type" data-sortable="true">是否主部门</th>
                <th data-field="dept_description_textarea" data-sortable="true">描述</th>
            </tr>
            </thead>
        </table>
    </div>
    <script type="text/javascript" src="${ctx}/js/system/organization/employee.js"></script>
    <script type="text/javascript">
        function showColOperator(v,row){
            //是否是主部门标识(true:主部门，false：辅部门)
            var type = row.type_flag;
            var butn = "";
            if(!type){
                butn = "<a href='#' id='"+row.id+"' type='"+type+"' onclick='delEmpDeptRelation(this);'><span class='glyphicon glyphicon-trash' style='padding-right: 5px;'></span></a>";
            }
            return butn;
        }
    </script>
</body>
</html>